<template>
  <div class="exhibits-content" :style="{ width: props.info.width + 'rem', height: props.info.height + 'rem' }">
    <t-image-viewer v-model:visible="ImgVisible" :images="[getLinkUrl(ImgUrl)]"> </t-image-viewer>
    <div
      class="decorate"
      :style="{
        'background-image': `url(${publicUrls + 'free/style1/exhibitionStandStyle3zs.webp'})`,
      }"
    ></div>
    <div class="list">
      <div
        class="list-left"
        :style="{
          'background-image': `url(${
            publicUrls + 'free/style1/exhibitionStandStyle3ItemLeft.webp'
          })`,
        }"
      ></div>
      <!-- <img
        class="list-left-zs"
        v-lazy="publicUrls + 'free/style1/exhibitionStandStyle3ItemCenterzs1.png?imageView2/3/format/webp'"
        alt=""
      /> -->
      <div
        class="list-conetnt"
        :style="{
          'background-image': `url(${
            publicUrls + 'free/style1/exhibitionStandStyle3ItemCenter.webp'
          })`,
        }"
      >
        <div
          class="exhibits-item"
          :style="{
            'background-image': `url(${
              publicUrls + 'free/style1/exhibitionStandStyle3Itembg.webp'
            })`,
          }"
          v-for="(item, index) in props.info.showpieceList"
          :key="index"
        >
          <div class="cover-box" @click="viewImg(item.moduleId, item.id)">
            <img class="cover" v-lazy="getLinkUrl(item.coverUrl, '?imageView2/3/w/600/format/webp')" alt="" />
            <img class="flower-btn" v-lazy="publicUrls + 'free/style1/flower.png?imageView2/format/webp'" />
          </div>
          <p>{{ item.name }}</p>
        </div>
        <div class="line"></div>
      </div>
      <!-- :style="{ 'background-image': `url(${publicUrls + 'free/style1/exhibitionStandStyle3zs.png'})` }" -->
      <div
        class="list-right"
        :style="{
          'background-image': `url(${
            publicUrls + 'free/style1/exhibitionStandStyle3ItemRight.webp'
          })`,
        }"
      ></div>
      <!-- <img
        class="list-right-zs" 
        v-lazy="publicUrls + 'free/style1/exhibitionStandStyle3ItemCenterzs2.png?imageView2/3/format/webp'"
        alt=""
      /> -->
    </div> 
    <!-- <div
      :style="{
        'background-image':
          (index + 1) % 2 === 0
            ? `url(${publicUrls + 'free/style1/exhibitionStandStyle1ItemRight.png'})`
            : `url(${publicUrls + 'free/style1/exhibitionStandStyle1ItemLeft.png'})`,
      }"
      class="exhibits-item"
      v-for="(item, index) in props.info.showpieceList"
      :key="index"
    ></div> -->
  </div>
</template>

<script lang="ts">
export default defineComponent({
  name: 'style3',
});
</script>

<script setup lang="ts">
import { publicUrls } from '@/utils/minxin';
import { DraggableContainer } from 'vue3-draggable-resizable';
// import FlotMenu from '@/components/flotMenu/OutlineMenu.vue';
import ContextMenu from '@imengyu/vue3-context-menu';
import { getDraggableNumber, getExhibitsHeightRest, getdisabledY } from '@/utils/getRemComputed';
import { ref, reactive, watch, nextTick, defineComponent } from 'vue';
import { exbitMenuShow, exbitListMenuShow } from '@/hooks/menuHooks';
import { useProjectStore } from '@/store';
import { getLinkUrl } from '@/utils/request/upload';

const emit = defineEmits([
  'emitChildItemDraggable',
  'emitChildItemDraggableStyle',
  'emitShowcaseDraggable',
  'emitShowcaseDraggableStyle',
  'onContextMenuChild',
]);
const store = useProjectStore();
const contextMenuTrigger = ref(); //列表盒子dom
const parentLock = ref(true);
const childShow = ref(true);
const draggableResizable = ref(); //父级拖拽盒子ref
const timer = ref();
const ImgVisible = ref(false);
const ImgUrl = ref('');

const props = defineProps({
  width: {
    type: Number || String,
  },
  height: {
    type: Number || String,
  },
  indexs: {
    type: Number,
  },
  info: {
    type: Object,
  },
  childId: {
    type: Number,
  },
  AuxiliaryId: {
    type: Number,
  },
});

const handleMouseDown = (event) => {
  event.stopPropagation();
};
const preventDefaultDrag = (event) => {
  event.stopPropagation();
};

const viewImg = (moduleId: number, e?: number) => {
  store.exhibitsModuleId = moduleId;
  store.exhibitsShowpieceid = e;
  store.exhibitsInfoShow = true;
};
</script>

<style lang="less" scoped>
.exhibits-content {
  position: relative;
  z-index: 999;
  padding: 10px;
  flex-shrink: 0;
}

.active {
  :deep(.flot-menu) {
    display: flex;
  }
}
:deep(.active) {
  z-index: 999;
}
:deep(.vdr-handle) {
  z-index: 66;
}
.decorate {
  width: 416px;
  height: 634px;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  margin-top: -83px;
  margin-right: 60px;
  flex-shrink: 0;
  -webkit-box-reflect: below -5% linear-gradient(transparent, rgba(0, 0, 0, 0.15));
}
.exhibits-item {
  width: 221px;
  height: 464px;
  padding: 0 14px;
  margin-left: 60px;
  background-position: bottom;
  background-size: contain;
  background-repeat: no-repeat;
  &:first-child {
    margin-left: 0;
  }

  .cover-box {
    width: 100%;
    height: 100%;
    position: relative;
    padding-bottom: 75px;

    &:hover {
      .flower-btn {
        display: none;
      }
    }
    .cover {
      width: 100%;
      height: 100%;
      object-fit: contain;
      background: #6c5c4f;
      padding: 3px;
    }
    .flower-btn {
      width: 40px;
      height: 40px;
      object-fit: cover;
      position: absolute;
      top: 40%;
      left: 50%;
      transform: translate(-50%, -40%);
      animation: flower 2s linear infinite;
      @keyframes flower {
        0% {
          opacity: 0;
        }
        40% {
          opacity: 100%;
        }
        80% {
          opacity: 100%;
        }
        100% {
          opacity: 0;
        }
      }
    }
  }
  ::v-deep p {
    color: #88786b;
    text-align: center;
    font-family: 'SourceHanSerifCN-Bold';
    font-size: 18px;
    line-height: 22px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 20px;
  }
}

.list {
  display: flex;
  align-items: flex-end;
  position: relative;
  // padding: 0 269px;
  // flex: 1;
  height: 682px;
}
.list-left {
  z-index: 6;
  display: flex;
  align-items: flex-end;
  position: absolute;
  top: 0;
  left: -5px;
  width: 269px;
  height: 690px;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  -webkit-box-reflect: below -5% linear-gradient(transparent, rgba(0, 0, 0, 0.15));
}
.list-conetnt {
  width: 100%;
  height: 650px;
  background-size: auto 100%;
  background-repeat: repeat;
  padding: 0 349px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25);
  .line {
    width: 8px;
    height: 650px;
    background: #87776a;
    position: absolute;
    top: 0;
    right: -8px;
  }
}
.list-right {
  z-index: 6;
  display: flex;
  align-items: flex-end;
  position: absolute;
  top: 0;
  right: -5px;
  width: 269px;
  height: 690px;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  -webkit-box-reflect: below -5% linear-gradient(transparent, rgba(0, 0, 0, 0.15));
}
.list-left-zs,
.list-right-zs {
  position: absolute;
  bottom: 0;
  width: 298px;
  height: 418px;
  object-fit: contain;
}
.list-left-zs {
  left: 139px;
}
.list-right-zs {
  right: 139px;
}
</style>
